package com.booter.config;

import com.bstek.ureport.console.UReportServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

import javax.servlet.Servlet;

@Configuration
@ImportResource("classpath:ureport-console-context.xml") // 加载ureport对应的xml配置文件
public class MvcConfig {


    @Bean
    public ServletRegistrationBean<Servlet> uReportServlet() {
        ServletRegistrationBean bean = new ServletRegistrationBean<>(new UReportServlet());
        bean.addUrlMappings("/ureport/*");
        return bean;
    }

}
